// Test method MUST be deleted in prod
function testInit() {
		Voc.addTerm(new Term("Mortgage", "A debt instrument that is secured by the collateral of specified real estate property and that the borrower is obliged to pay back with a predetermined set of payments"));
		Voc.addTerm(new Term("Debt", "An amount of money borrowed by one party from another. Many corporations/individuals use debt as a method for making large purchases that they could not afford under normal circumstances"));
		Voc.addTerm(new Term("Default Risk", "The event in which companies or individuals will be unable to make the required payments on their debt obligations. Lenders and investors are exposed to default risk in virtually all forms of credit extensions"));
		Voc.addTerm(new Term("Abnormal returns", "Part of the return that is not due to systematic influences (market wide influences). In other words, abnormal returns are above those predicted by the market movement alone."));
		Voc.addTerm(new Term("Accounts payable", "Money owed to suppliers"));
		Voc.addTerm(new Term("Active", "A market in which there is much trading"));
		Voc.addTerm(new Term("Shares", "Certificates or book entries representing ownership in a corporation or similar entity"));
		Voc.addTerm(new Term("Shop", "Wall Street jargon for a firm"));
		Voc.addTerm(new Term("Wall Street", "Generic term for firms that buy, sell, and underwrite securities"));
		Voc.addTerm(new Term("Wallflower", "Stock that has fallen out of favor with investors; tends to have a low P/E (price to earnings ratio)"));
		Voc.addTerm(new Term("Wash", "Gains equal losses"));
		Voc.addTerm(new Term("Pairoff", "A buy-back to offset and effectively liquidate a prior sale of securities"));
		Voc.addTerm(new Term("Paper", "Money market instruments, commercial paper and other"));
		Voc.addTerm(new Term("Par value", "Also called the maturity value or face value, the amount that the issuer agrees to pay at the maturity date"));
		Voc.addTerm(new Term("Pairoff", "A buy-back to offset and effectively liquidate a prior sale of securities"));
	}


$(document).ready(function() {
	
	bgPage.oauth.authorize(function(){});
	
	$("#tfTerm").keypress(function(event) {
		if ( event.which == 13 ) {
			event.preventDefault();
			value = $("#tfTerm").val();
			Voc.addTerm(new Term(value, '')); 
			utils.refreshList();
			$("#tfTerm").val('');
		}
	});

	if (!Voc.init()) {
	  testInit();
	} 	
	utils.refreshList();
	

});
